package com.chentongwei.spring.annotation.Import.selector;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @author TongWei.Chen 2018-07-05 15:06:31
 * @Description:
 * @Project spring-annonation
 */
public class MyImportSelector implements ImportSelector {

    /**
     * 自定义逻辑返回需要导入的组件的数组
     *
     * @param importingClassMetadata：当前标注@Import注解的所有注解信息
     * @return： 要导入到容器中的组件的全类名
     */
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        return new String[] {"com.chentongwei.spring.annotation.Import.entity.Blue", "com.chentongwei.spring.annotation.Import.entity.Yellow"};
    }
}
